package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 心理测评问卷中的一条问题
 * </p>
 *
 * @author hyb
 * @since 2024-12-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Question implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 一个问卷题目id
     */
    @TableId(value = "question_id", type = IdType.AUTO)
    private Integer questionId;

    /**
     * 题目题号，按照题号排列题目
     */
    private Integer questionNum;

    /**
     * 题目题干
     */
    private String text;

    /**
     * 选项一文本
     */
    private String optionText1;

    /**
     * 选项二文本
     */
    private String optionText2;

    /**
     * 选项三文本
     */
    private String optionText3;

    /**
     * 选项四文本
     */
    private String optionText4;

    /**
     * 所属的问卷id
     */
    private Integer questionaireId;

    /**
     * 0无效 1有效
     */
    private Integer isActive;

    /**
     * 记录最后更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 记录创建时间
     */
    private LocalDateTime createTime;
    public Question(Integer questionId,Integer questionNum,String text,String optionText1,String optionText2,String optionText3,String optionText4,Integer questionaireId) {
        this.questionId = questionId;
        this.questionNum = questionNum;
        this.text = text;
        this.optionText1 = optionText1;
        this.optionText2 = optionText2;
        this.optionText3 = optionText3;
        this.optionText4 = optionText4;
        this.questionaireId = questionaireId;
        this.isActive = 1;
        this.updateTime = LocalDateTime.now();
        this.createTime = LocalDateTime.now();
    }


}
